#include <iostream>

using namespace std;


class A
{
public:
	int _a;
};

//class B : public A
class B : virtual public A
{
public:
	int _b;
};

//class C : public A
class C : virtual public A
{
public:
	int _c;
};

class D : public B, public C
{
public:
	int _d;
};

void test()
{
	A a;
	B b;
	C c;
	D d;

	a._a = 1;

	b._b = 2;
	b._a = 22;

	c._c = 3;
	c._a = 33;

	d._d = 4;
	d._b = 44;
	d._c = 55;

	d.B::_a = 5;
	d.C::_a = 6;

	cout << sizeof(a) << endl;
	cout << sizeof(b) << endl;
	cout << sizeof(c) << endl;
	cout << sizeof(d) << endl;


}






int main()
{
	test();
	return 0;
}